//
//  AFNetRequest.h
//  YLNetworkingFrameworks
//
//  Created by Topsun on 16/6/1.
//  Copyright © 2016年 tcl. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetResponse.h"

@class ParameterEntity;

// 获取数据的优先级
typedef NS_ENUM(NSInteger ,RequestPriority)
{
    // 优先从本地获取数据，如果获取失败，则从网络获取
    RequestPriorityDisk = 0,
    
    // 优先从网络获取数据，如果失败，则从本地获取
    RequestPriorityNetWork = 1,
};

@interface AFNetRequest : NSObject

@property (nonatomic , strong) AFNetResponse   * netResponse;     //该请求对象的对应的http响应对象
@property (nonatomic , strong) NSString        * requestTypeKey;  // 请求类型的Key
@property (nonatomic , strong) NSObject        * userInfo;        //用户自定义数据结构
@property (nonatomic , strong) NSString        * requestMethod;   // 网络请求方式（post or get ...）
@property (nonatomic , strong) NSURL           * requestURL;      //请求的网络地址
@property (nonatomic , assign) int               tag;             //标识对象
@property (nonatomic , assign) BOOL              isSerialize;     //是否序列化该请求
@property (nonatomic , assign) RequestPriority   requestPriority; // 数据优先模式
@property (nonatomic , strong) ParameterEntity * parameterEntity; //请求参数实体对象

// 获得当前请求对像的唯一标识
- (NSString*) getRequestUUID;

@end

@interface ParameterEntity : NSObject

@property (nonatomic , readonly) NSMutableDictionary * postDictionary;//提交的表单数据
@property (nonatomic , readonly) NSMutableDictionary * headDictionary;// 提交的头数据
@property (nonatomic , readonly) NSMutableDictionary * getDictionary; // GET方式的参数

// 添加一个Post请求参数
- (void) setPostValue:(id<NSObject>)value forKey:(NSString *)key;

// 添加一个Get请求参数
- (void) setGetValue:(id<NSObject>)value forKey:(NSString *)key;

// 添加一个Head请求参数
- (void) setHeadValue:(id<NSObject>)value forKey:(NSString *)key;

// 添加一个参数
- (void) setValue:(id<NSObject>)value forKey:(NSString *)key forMethod:(NSString*) method;

@end